<template>
  <div>
     <h2>Vue基本语法之"{(  )}"</h2>
     <p>{{ str }}</p>
     <p>{{ msg }}</p>
     <input type="button" value="点击我" v-on:click="fn"/>
     <input type="button" value="修改str的值" @click="fn1"/>
  </div>
</template>

<script setup lang="ts">
import {ref} from 'vue'

//vue中不能这样生命数据，这样声明的数据不叫响应式数据
//响应式数据:数据变了，视图会更新
let str = "hello"
let msg = "好好学习，天天向上"

let person = ref({
  name:"张三",
  age:20,
  sex:"男"
})

function fn(){
  alert("我要好好学习了，不要打扰我!!!");
}

function fn1(){
  str = 'hi'
  console.log(str);
}
</script>

<style scoped>

</style>